package com.example.administrator.testc.NightMode;/**
 * Created by maze on 2016/6/30.
 */

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.administrator.testc.R;

/**
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>类描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>属性描述
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>方法描述
 */
public class TestMain extends Activity {

    private NightModeHelper mNightModeHelper;
    private boolean isOpen = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_send_msg);
        mNightModeHelper = new NightModeHelper(this, R.style.Theme_Test);
        findViewById(R.id.btnSend).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(isOpen){
                    mNightModeHelper.notNight();
                    Toast.makeText(getApplicationContext(), "notNight", Toast.LENGTH_SHORT).show();
                }else{
                    mNightModeHelper.night();
                    Toast.makeText(getApplicationContext(), "night", Toast.LENGTH_SHORT).show();
                }
                recreate();
                isOpen = !isOpen;
            }
        });
    }
}
